<?php
class Mpermissions extends CI_Model{
	protected $_table="tpt_permissions";
	public function __construct(){
		parent::__construct();	
	}
    
	public function listPermission($arrCol){
        $this->db->select(implode(',',$arrCol));
        return $this->db->get($this->_table)->result_array();    
    }

    public function list_all(){
		return $this->db->get($this->_table)->result_array();
    }

    public function insert($data){
        $this->db->insert($this->_table,$data);
    }

    public function get_data($id){
        $this->db->where('id',$id);
        return $this->db->get($this->_table)->row_array();
    }

    public function update($data,$id){
        $this->db->where('id',$id);
        $this->db->update($this->_table,$data);
    }

    public function delete($id){
        $this->db->where('id',$id);
        $this->db->delete($this->_table,$data);
    }
}